<?php

namespace app\adminapi\validate;

use app\common\validate\BaseValidate;

class LoginValidate extends BaseValidate
{
    protected $rule = [
        'pageNo' => 'regex:/^([1-9]\d*)$/',
        'pageSize' => ['regex'=>'/^(-1|[1-9]\d*)$/'],
        'userName' => 'require',
        'password' => 'require',
        'logIds' => 'require'
    ];

    protected $message = [
        'pageNo.regex' => '分页页码只能是数字',
        'pageSize.regex' => '分页页大小只能是数字',
        'userName.require' => '请输入用户名',
        'password.require' => '请输入密码',
        'logIds.require' => '参数不完整'
    ];

    protected $scene = [
        'login' => ['userName', 'password'],
        'list' => ['pageNo', 'pageSize'],
        'delete' => ['logIds']
    ];
}